<script type="text/javascript" >
//<![CDATA[
$(document).ready(function() {
	document.forms["board_insert_form"].elements["eb_subject"].focus();
});

function goto_submit()
{
	<?php if ($_set['artcat_flag']) { ?>
		var tmp = document.board_insert_form.eb_ebcfacid.value;
		if(tmp !='')
		{
			if($("#board_insert_form").valid()) document.board_insert_form.submit();
			else return false;
		}
		else alert("분류를 선택해주세요");

	<?php } else { ?>
		if($("#board_insert_form").valid()) document.board_insert_form.submit();
		else return false;
	<?php } ?>
}

//]]>
</script>
<div id="lay_board_write">
<form name="board_insert_form" id="board_insert_form" method='post' action="<?=$EzbbsManager->get_url_root()?>/index.php" target="form_receiver" <?php if ($_set['file_num']) { ?> enctype="multipart/form-data"<?php } ?> onsubmit="goto_submit(); return false;">
<fieldset>
<div id="insert_title">
<h2><?=$_lang['write_title']?></h2>
</div>

<dl>
<?php if ($_set['notice']) { ?>
<dt><?=$_lang['notice']?></dt>
<dd><?=$Html->check_button('eb_notice_flag', array('1' => ''))?><?=$_lang['notice_msg']?></dd>
<?php } ?>
<?php if ($_set['lock_flag']) { ?>
<dt><?=$_lang['lock']?></dt>
<dd><?=$Html->check_button('eb_lock_flag', array('1' => ''))?><?=$_lang['lock_msg']?></dd>
<?php } ?>
<?php if ($_set['artcat_flag']) { ?>
<dt><?=$_lang['category']?></dt>
<dd><?=$Html->select_form('eb_ebcfacid', array('' => '분류 선택') + $category_list, $artcat, 'ebcfac_id', 'ebcfac_pname','')?></dd>
<?php } ?>
<dt><?=$_lang['subject']?></dt>
<dd> <!-- <?php if ($_set['artcat_flag']) { ?><?=$Html->select_form('eb_ebcfacid', array('' => '분류 선택') + $category_list, $artcat, 'ebcfac_id', 'ebcfac_pname','')?>&nbsp;
<?php } ?> --> <input name="eb_subject" type="text" title="<?=$_lang['subject_error']?>" value="<?=$source_subject?>" class="required cla_input70" /></dd>
<?php if ($_print['name']) { ?>
<dt><?=$_lang['name']?></dt>
<dd><input type="text" name="eb_name" size="20" maxlength="20" title="<?=$_lang['name_error']?>" class="required" <?php if($_SESSION['realName']) { ?> readonly value="<?=$_SESSION['realName']?>" <?php } ?> /></dd>
<?php } ?>
<?php if (!$User->is_login()) { ?>
<dt><?=$_lang['pass']?></dt>
<dd><input type="password" name="eb_pw" size="16" maxlength="16" title="<?=$_lang['pass_error']?>" class="required"/></dd>
<?php } ?>
<?php if ($_print['eml']) { ?>
<dt><?=$_lang['eml']?></dt>
<dd><input name="eb_eml" type="text" title="<?=$_lang['eml']?>" class="cla_input90" /></dd>
<?php } ?>
<?php if ($_print['url']) { ?>
<dt><?=$_lang['url']?></dt>
<dd><input name="eb_url" type="text" title="<?=$_lang['url']?>" class="cla_input90" /></dd>
<?php } ?>
<dt><?=$_lang['text']?></dt>
<?php if ($_set['editor_flag']) { ?>
<dd class="editor"><input type='hidden' name='eb_html_flag' value='1'><input type='hidden' name='eb_br_flag' value='0'><?=$ckeditor->editor('eb_txt'); ?>
</dd>
<dd><div style="clear:both;"></div></dd>
<?php } else { ?>
<dd><?php if ($_set['html_flag']) { ?><?=$Html->check_button("eb_html_flag", array('1' => $_lang['html']))?><?php } ?><?=$Html->check_button("eb_br_flag", array('1' => $_lang['br']), array('1'))?></dd>
<dd><textarea name="eb_txt" rows="30" title="<?=$_lang['text_error']?>" cols="10" class="required"><?=$source_text?></textarea></dd>
<?php } ?>
<?php foreach ($add_column_list as $v) { ?>
<dt><?=$v['ebcfad_pname']?><input type='hidden' name='ebad_id[]' value="<?=$v['ebcfad_id']?>"></dt>
<dd><?php if ($v['ebcfad_form'] == 'I') { ?><input name="ebad_txt[]" type="text" size="<?=$v['ebcfad_width']?>"><?php } else if ($v['ebcfad_form'] == 'T') { ?><textarea name="ebad_txt[]" cols="<?=$v['ebcfad_width']?>" rows="<?=$v['ebcfad_height']?>"></textarea><?php } ?></dd>
<?php } ?>
<?php if ($_set['file_num']) { ?>
<?php for ($i=0, $size=$_set['file_num']; $i<$size; $i++) { ?>
<dt><?=$_lang['file'].($i+1)?></dt>
<dd><input type="file" name="upload_file_<?=$i?>" class="input_text" size="42" title="첨부파일<?=$i?>을 입력하세요." /></dd>
<?php } ?>
<?php } ?>
</dl>
<input type="hidden" name="job" value="insert" />
<input type="hidden" name="subjob" value="ok" />
<input type="hidden" name="eb_seq" value="<?=$eb_seq?>" />
<?php foreach ($paras as $k => $v) { ?><input type="hidden" name="<?=$k?>" value="<?=$v?>" /><?php } ?>
<?php if ($_set['file_num']) { ?><input type="hidden" name="max_file_size" value="<?=$_set['file_size']?>" /><?php } ?>
<div id="lay_board_search">
<ul id="lay_board_list_util">
<li><input type="image" src="<?=$App->_url_board?>/skin/default/images/kor/btn_write.gif" alt="<?=$_lang['write']?>" /></li>
<li><a href="/" onclick="history.back(); return false;"><img src="<?=$App->_url_board?>/skin/default/images/kor/btn_cancel.gif" alt="<?=$_lang['cancel']?>" /></a></li>
<li><a href="<?=$_SERVER['PHP_SELF']?>?job=list&amp;<?=http_build_query($paras, '', '&amp;')?>"><img src="<?=$App->_url_board?>/skin/default/images/kor/btn_list.gif" alt="<?=$_lang['list']?>" /></a></li>
</ul>
</div>
</fieldset>
</form>
</div>